#!/usr/bin/env python
PACKAGE = "peac"

from dynamic_reconfigure.parameter_generator_catkin import *

gen = ParameterGenerator()

gen.add("distance_min", double_t, 0, "unit: cm, distance range min", 0,0,100)
gen.add("distance_max", double_t, 0, "unit: cm, distance range max", 300,500,600)

gen.add("minSupport", int_t, 0, "min number of supporting point", 500, 0, 1000)
gen.add("windowWidth", int_t, 0, "make sure width is divisible by windowWidth", 4, 1, 20)
gen.add("doRefine", bool_t, 0, "perform refinement of details or not", True)

InitType = gen.enum([ gen.const("INIT_STRICT", int_t, 0, "no nan point is allowed in any valid init blocks"),
                       gen.const("INIT_LOOSE", int_t, 1, "at most half of a init block can be nan point")],
                     "InitType")
gen.add("initType", int_t, 0, "Select InitType", 1, 0, 1, edit_method=InitType)

gen.add("stdTol_merge", int_t, 0, "epsilon in the paper, used when merging nodes, unit: u mm", 8,0,20)
gen.add("stdTol_init", int_t, 0, "epsilon in the paper, used when init graph, unit: u mm", 5,0,20)
gen.add("depthSigma", double_t, 0, "sigma in the paper, unit: u^-1 mm^-1", 1.6e-6,0,1)

gen.add("depthAlpha", double_t, 0, "unit: none, corresponds to the 2*alpha in the paper", 0.04,0,5)
gen.add("depthChangeTol", double_t, 0, "unit: u mm", 0.02,0,5)

gen.add("z_near", double_t, 0, "unit: u mm, closest z to be considered", 500,0,1000)
gen.add("z_far", double_t, 0, "unit: u mm, farthest z to be considered", 4000,1000,6000)
gen.add("angle_near", double_t, 0, "unit: rad, corresponding normal deviation angle", 15.0,0,90)
gen.add("angle_far", double_t, 0, "unit: rad, corresponding normal deviation angle", 90,0,90)
gen.add("similarityTh_merge", double_t, 0, "unit: none, 1 means the same, 0 means perpendicular", 60,0,90)
gen.add("similarityTh_refine", double_t, 0, "unit: none", 30,0,90)

exit(gen.generate(PACKAGE, "peac_param_node", "peac_param"))